<script setup lang="ts">
import * as echarts from 'echarts'
import { onMounted, ref } from 'vue'
// 获取DOM节点
const charts = ref()
// 组件挂载完毕
onMounted(() => {
  // 一个容器可以同时展示多种类型的图形图标
  echarts.init(charts.value).setOption({
    // legend: {
    //   data: ['Allocated Budget', 'Actual Spending']
    // },
    radar: {
      // shape: 'circle',
      indicator: [
        { name: 'Sales', max: 6500 },
        { name: 'Administration', max: 16000 },
        { name: 'Information Technology', max: 30000 },
        { name: 'Customer Support', max: 38000 },
        { name: 'Development', max: 52000 },
        { name: 'Marketing', max: 25000 },
      ],
    },
    series: [
      {
        name: 'Budget vs spending',
        type: 'radar',
        data: [
          {
            value: [4200, 3000, 20000, 35000, 50000, 18000],
            name: '购物',
          },
          {
            value: [5000, 14000, 28000, 26000, 42000, 21000],
            name: '吃饭',
          },
        ],
      },
    ],
  })
})
</script>

<template>
  <div class="box8">
    <div class="title">
      <p>年度游客容量对比</p>
      <img src="../../images/dataScreen-title.png" alt="" />
    </div>
    <!--    图形图标的容器-->
    <div class="charts" ref="charts"></div>
  </div>
</template>

<style scoped lang="scss">
.box8 {
  width: 100%;
  height: 100%;
  background: url(../../images/dataScreen-main-rb.png) no-repeat;
  background-size: 100% 100%;
  margin-top: 20px;

  .title {
    margin-left: 5px;

    p {
      color: white;
      font-size: 20px;
    }
  }

  .charts {
    height: calc(100% - 30px);
  }
}
</style>
